import axios from '@/ajax/config'

/**
 * @param param
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
//是否开通AI外呼
export function getAllStatus() {
  return axios.post('/scrm-api/ai/get-ai-status')
}
// 提交申请
export function createAcount(params: any) {
  return axios.post('/scrm-api/ai/create-account', params)
}
// 菜单列表
export function getMemuList() {
  return axios.post('/scrm-api/ai/get-menu-list')
}
//获取云蝠授权客户端URL
export function getYfUrl() {
  return axios.post('/scrm-api/ai/get-yf-auth-url')
}
// 获取授权后登录
export async function getPageToken() {
  const res: any = await getAllStatus()
  // await getMemuList()
  if (res.status == 1) {
    return getYfUrl()
    // return res
  } else {
    return res
  }
}
